home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / sch250.zip / DMDEMO.PRG < prev    next >
Text File  |  1995-02-17  |  3KB  |  125 lines

  1. *****
  2. * DMDEMO.prg
  3. * A sample SCHOONER program to demonstrate the ease and 
  4. * power of SCHOONER.
  5. *
  6. * This program is a simple but useful database system that demonstrates
  7. * most of the concepts found in SCHOONER and virtually all other power
  8. * databases.
  9. *****
  10. *****
  11. * Public variables
  12. *****
  13. public mvschooner
  14. public mvchoice
  15. public mvmainscrn
  16. public mvparm1
  17. public mvparm2
  18. public mvparm3
  19. public mvkeyval
  20. public mvtemp
  21. public mvscreen
  22. public mvtempmemo
  23. public mvstate
  24. public mvudfscrn
  25. public mvselect
  26. public mvstroke
  27. public mvudf_val
  28.  
  29. *****
  30. * Set defaults
  31. *****
  32. clearscrn()
  33. setscorebd(.f.)
  34. setcolor("w+/b,w+/bg,gr+,b,gr+/b")
  35. setcursor(.t.)
  36. setbell(.t.)
  37. setconfirm(.t.)
  38. setdeleted(.f.)
  39. *****
  40. * It is always a good idea to select your database whenever you
  41. * think it might possibly be unselected. In addition, make sure it
  42. * is open...
  43. *****
  44. if .not. is_open("dmdemo")
  45.     open("dmdemo","",.T.,"dmdemo")
  46. else
  47.     fselect("dmdemo")
  48. endif
  49. superbox(00,00,24,79,.t.,"▓",.f.)
  50. superbox(05,10,19,70,.f.,"",.t.)
  51. superbox(07,11,07,69,.f.,"",.f.)
  52. superbox(17,11,17,69,.f.,"",.f.)
  53. say(06,28,"Schooner Sample Database")
  54. say(18,23,"Highlight selection and press ENTER")
  55. do while .t.
  56.     *****
  57.     * It is always a good idea to select your database whenever you
  58.     * think it might possibly be unselected. In addition, make sure it
  59.     * is open...
  60.     *****
  61.     if .not. is_open("dmdemo")
  62.         open("dmdemo","",.T.,"dmdemo")
  63.     else
  64.         fselect("dmdemo")
  65.     endif
  66.     setcursor(.f.)
  67.     setwrap(.t.)
  68.     setmessage(23,"center")
  69.     mvchoice=0
  70.     prompt(09,11,"                     Add New Address                       ","   Add a new address to the database    ")
  71.     prompt(10,11,"              Edit/Delete  Existing Address                ","Edit an existing address in the database")
  72.     prompt(11,11,"                      Run a Report                         ","          Print a sample report         ")
  73.     prompt(12,11,"                      Print Labels                         ","           Print sample labels          ")
  74.     prompt(13,11,"                     Graphics  Demo                        ","    Display a sample graphics screen    ")
  75.     prompt(14,11,"                 Programmable Text Editor                  ","    Try the programmable text editor    ")
  76.     menuto("mvchoice")
  77.     mvmainscrn=savescreen(0,0,24,79)
  78.     if mvchoice=0
  79.         exit
  80.     endif
  81.     if mvchoice=1
  82.         do dmaddnew
  83.     endif
  84.     if mvchoice=2
  85.         do dmbrow
  86.     endif
  87.     if mvchoice=3
  88.         clearscrn()
  89.         message("Printing report. Please wait...","off")
  90.         setconsole(.f.)
  91.         reportform("dmreport","ALL","dmreport.rpt")
  92.         setconsole(.t.)
  93.     endif
  94.     if mvchoice=4
  95.         clearscrn()
  96.         message("Printing labels. Please wait...","off")
  97.         setconsole(.f.)
  98.         labelform("dmlabel","ALL","dmlabel.Lab")
  99.         setconsole(.t.)
  100.     endif
  101.     if mvchoice=5
  102.         do dmgraph
  103.     endif
  104.     if mvchoice=6
  105.         do dmmemo
  106.     endif
  107.     if mvchoice>6
  108.         message("That option is not available at this time.")
  109.     endif
  110.     mvmainscrn=restscreen(0,0,24,79,mvmainscrn)
  111. enddo
  112. message("Thank you for trying the SCHOONER sample database")
  113. setcursor(.t.)
  114. closefile()
  115. quit
  116. 
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.